// Lindsay Gilmour
// Adam Lusch
// Dan Niceswanger
//
// Computer Graphics Project 2:
// Teapot Racing!

#ifndef PHYSICS_WORLD_H
#define PHYSICS_WORLD_H

#include <GL/glut.h>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <string>
using namespace std;

#include <Box2D.h>

#include "Checkpoint.h"
#include "Ghostpot.h"
#include "GhostRecord.h"
#include "Render.h"
#include "Teapot.h"
#include "Timer.h"
#include "Track.h"

class PhysicsWorld
{
	public:

		PhysicsWorld();
		~PhysicsWorld();
		
		void startGame();
		void init();
		
		void splashScreen();
		
		void initCheckpoints();
		
		void checkpointStatus();
		
		void step(float32, int32, int32*);
		
		void drawText(float32, float32, string);
		
		static const int LAP_COUNT;
		static int RACE_MODE;

	private:
		
		void spawnPlayer();
		void updateCheckpoint();
		
		b2AABB worldAABB;
		bool doSleep;
		b2World* world;
		
		Teapot* player;
		Ghostpot* ghost;

		GhostRecord* record;

		Timer* timer;
		Timer* lapTimer;
		
		Track* track;
		
		vector <Checkpoint> checkpoints;
		int currentCheckpoint;
		int currentLap;
		
		bool isPlaying;
		float rotate;
		
		DebugDraw debug;
};


#endif
